#include "typedef.h"
#include "main_func.h"
#include "config.h"
#include "modbus.h"
#include "uart.h"
#include "include.h"
void check_tx_IRQ(void);
void meun_show(void);

void main_init(void){
	config_init();
	uart_ringbuffer_init();
	master_init();
}

void main_func(void){
	modbus_func();
	meun_show();
	check_tx_IRQ();
	WDT_KEY = WDT_KEY_VAL(0xAA);
}

void check_tx_IRQ(void){
	if(UART1_STA & UART_TX_DONE(0x01)){
		uint8_t c;
		if(uart_ringbuffer_tx_read(PORT1, &c)){
			UART1_DATA = c;
		}
	}
}